package com.itheima.xxljob.job;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class HelloJob {

    //注入端口号
    @Value("${server.port}")
    private String appPort;

    @XxlJob("hwl02")
    public ReturnT<String> hello(String param){
        System.out.println("xxljob每五秒执行一次"+new Date()+"端口号:"+appPort);

        return ReturnT.SUCCESS;
    }
}
